/*
 * Copyright (C) 2021 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cn.edu.tjnu.simplequery.domain.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.Hibernate;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * 用户实体类。
 *
 * @author 王帅
 * @since 1.0
 */
@Entity
@Getter
@Setter
@ToString
@Table(name = "sys_record")
public class SysRecord {

    @Id
    @GeneratedValue
    @Column(name = "id")
    private Integer id;

    @Column(name = "number")
    private String number;

    @Column(name = "name")
    private String name;

    @Column(name = "required_data")
    private String requiredData;

    @Column(name = "reason")
    private String reason;

    @Column(name = "create_date")
    private Timestamp createDate;

    @Column(name = "is_pass")
    private Byte isPass;

    @Column(name = "pass_date")
    private Timestamp passDate;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) {
            return false;
        }
        SysRecord sysRecord = (SysRecord) o;
        return id != null && Objects.equals(id, sysRecord.id);
    }

    @Override
    public int hashCode() {
        return getClass().hashCode();
    }

}
